package com.hrm.controller.code;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.hrm.model.dto.code.CodeDTO;
import com.jungbo.paging.IPagingDao;
import com.jungbo.paging.PageUtil;

public class CodeSearchController implements Controller{
	private IPagingDao pagingService;

	public void setPagingService(IPagingDao pagingService) {
		this.pagingService = pagingService;
	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		ModelAndView mv = new ModelAndView();
		
		List<CodeDTO> list = null;
		
		PageUtil.pageContollerHelp(pagingService, request, 10, 10, "CodeMap.getCodeCountPaging", "CodeMap.getAllCodePaging", false);
		
		mv.addObject("list", list);
		mv.setViewName("codeList");
		
		return mv;
	}
	
}
